var compInfos =
    "a1a40313821111e99c7e7cd30ad3a6a8\t安徽伯渡劳务服务有限公司\n" +
    "a1a46f66821111e99c7e7cd30ad3a6a8\t安徽数集通劳务服务有限公司\n" +
    "a1a401de821111e99c7e7cd30ad3a6a8\t广东顺德伯渡服务外包营运管理有限公司\n";

String.prototype.format = function () {
    var args = arguments;
    return this.replace(/\{(\d+)\}/gm, function (ms, p1) {
        return typeof (args[p1]) == 'undefined' ? ms : args[p1]
    });
}

exports.getCompId= function ( comp) {
    var compId = "";
    var infos = compInfos.split("\n");
    for (let i = 0; i < infos.length - 1; i++) {
        let comps = infos[i].split("\t");
        if (comps[1] == comp) {
            compId = comps[0];
            break
        }
    }
    return compId;
}

